@echo off
远程协助工具集
:start
cls
chcp 65001
color 0a
MODE con: COLS=60 LINES=20
echo.
echo  ===============================
echo   git代理设置
echo  ===============================
echo.
echo  1. 打开全局代理
echo.
echo  2. 关闭全局代理
echo.
echo.
:cho
set choice=
set /p choice=  请输入编号:
IF NOT "%choice%"=="" SET choice=%choice:~0,1%

if /i "%choice%"=="1" goto TurnOn
if /i "%choice%"=="2" goto TurnOff

:TurnOn
echo 1.Http
echo  2.Socks5
echo.
echo.

set host=
set http=http://
set socks5=socks5://
:cho
set protocol=
set /p protocol=  请输入编号:
IF NOT "%protocol%"=="" SET protocol=%protocol:~0,1%

if /i "%protocol%"=="1" set  host=%http%
if /i "%protocol%"=="2" set  host=%socks5%
set /p port=  请输入端口:
set host=%host%127.0.0.1:%port%
git config --global http.proxy  %host%
git config --global https.proxy %host%
echo %host%
pause
exit

:TurnOff

git config --global --unset http.proxy 
git config --global --unset https.proxy
echo "取消代理成功"
pause
exit
